package day_2022_9_to_12.Day;

/**
 * @author haomin
 * @date 2022/09/27 17:06
 **/
public class Day26_1_Op01_02_CheckPermutation {
    class Solution {
        public boolean CheckPermutation(String s1, String s2) {
            if(s1.length() != s2.length()) return false;
            int[] arr = new int[26];
            for(int i = 0; i < s1.length(); ++i){
                arr[s1.charAt(i)-'a']++;
                arr[s2.charAt(i)-'a']--;
            }
            for(int i : arr){
                if(i != 0) return false;
            }
            return true;
        }
    }
}